﻿using System.Collections.Generic;
using SystemModule;

namespace M2Server
{
    public partial class TPlayObject
    {
        public override bool Operate(TProcessMessage ProcessMsg)
        {
            bool result = false;
            TCharDesc CharDesc;
            ushort nCode = 0;
            try
            {
                if (ProcessMsg == null)
                {
                    return false;
                }
                nCode = 1;
                if (FServerProcess.ContainsKey(ProcessMsg.wIdent))
                {
                    FServerProcess[ProcessMsg.wIdent](ProcessMsg, ref result);
                    return result;
                }
                switch (ProcessMsg.wIdent)
                {
                    case Grobal2.CM_RECALLHERO:// 召唤英雄
                        nCode = 2;
                        if (ProcessMsg.nParam2 == 8)
                        {
                            ClientRecallDeputyHero();
                        }
                        else
                        {
                            ClientRecallHero();
                        }
                        break;
                    case Grobal2.CM_HEROLOGOUT:// 英雄退出
                        nCode = 3;
                        ClientHeroLogOut(0);
                        break;
                    case Grobal2.CM_QUERYHEROBAGITEMS:// 刷新英雄的包裹
                        nCode = 4;
                        if (m_MyHero != null)
                        {
                            ((THeroObject)(m_MyHero)).ClientQueryBagItems();// 发送英雄包裹
                            this.SendMsg(this, Grobal2.RM_SENDHEROUSEITEMS, 0, 0, 0, 0, "");// 发送英雄身上装备
                            this.SendMsg(this, Grobal2.RM_SENDHEROMYMAGIC, 0, 0, 0, 0, "");// 发送英雄使用魔法
                            this.SendMsg(this, Grobal2.RM_QUERYHEROBAGCOUNT, 0, ((THeroObject)(m_MyHero)).m_nItemBagCount, 0, 0, "");// 发送英雄包裹容量
                            ((THeroObject)(m_MyHero)).SendMsg(m_MyHero, Grobal2.RM_HEROABILITY, 0, 0, 0, 0, "");// 发送英雄属性  
                            ((THeroObject)(m_MyHero)).SendMsg(m_MyHero, Grobal2.RM_HEROSUBABILITY, 0, 0, 0, 0, "");// 发送英雄属性
                        }
                        break;
                    case Grobal2.CM_HEROAUTOOPENDEFENCE:// 客户端设置英雄持续开盾
                        if (m_MyHero != null)
                        {
                            ((THeroObject)(m_MyHero)).boAutoOpenDefence = ProcessMsg.nParam1 == 1;
                            if (((THeroObject)(m_MyHero)).boAutoOpenDefence)
                            {
                                this.SysMsg("(英雄)已开启持久开盾", TMsgColor.c_Blue, TMsgType.t_Hint);
                            }
                        }
                        break;
                    case Grobal2.CM_HEROMAGICKEYCHANGE:// 客户端设置英雄魔法开关
                        nCode = 3;
                        if (m_MyHero != null)
                        {
                            ((THeroObject)(m_MyHero)).ChangeHeroMagicKey(ProcessMsg.nParam1, ProcessMsg.nParam2);
                        }
                        break;
                    case Grobal2.CM_QUERYHEROBAGCOUNT:
                        nCode = 4;
                        if (m_MyHero != null)
                        {
                            this.SendMsg(this, Grobal2.RM_QUERYHEROBAGCOUNT, 0, ((THeroObject)(m_MyHero)).m_nItemBagCount, 0, 0, "");// 发送英雄包裹容量
                        }
                        break;
                    case Grobal2.CM_HEROTAKEONITEM:// 英雄穿装备
                        nCode = 5;
                        ClientHeroTakeOnItems((byte)ProcessMsg.nParam2, ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_HEROTAKEOFFITEM:// 8103
                        nCode = 6;
                        ClientHeroTakeOffItems((byte)ProcessMsg.nParam2, ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_TAKEOFFITEMHEROBAG:
                    case Grobal2.CM_TAKEOFFITEMTOMASTERBAG:// 装备脱下到英雄包裹 //装备脱下到主人包裹
                        nCode = 7;
                        ClientHeroTakeOffItemsToBag(ProcessMsg.wIdent, (byte)ProcessMsg.nParam2, ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_SENDITEMTOMASTERBAG:
                    case Grobal2.CM_SENDITEMTOHEROBAG:// 主人包裹到英雄包裹 //英雄包裹到主人包裹
                        nCode = 8;
                        ClientBagToBag(ProcessMsg.wIdent, ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_HEROTAKEONITEMFORMMASTERBAG:
                    case Grobal2.CM_TAKEONITEMFORMHEROBAG:// 从主人包裹穿装备到英雄包裹 //从英雄包裹穿装备到主人包裹
                        nCode = 9;
                        ClientTakeOnItemsFormBag(ProcessMsg.wIdent, (byte)ProcessMsg.nParam2, ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_HEROEAT:// 5043
                        nCode = 10;
                        ClientHeroUseItems(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_HEROCHGSTATUS:// 改变英雄状态
                        nCode = 11;
                        ClientChgHeroStatus();
                        break;
                    case Grobal2.CM_HEROPROTECT:// 英雄守护
                        nCode = 12;
                        ClientHeroProtect(ProcessMsg.nParam2, ProcessMsg.nParam3);
                        break;
                    case Grobal2.CM_HEROATTACKTARGET:// 锁定目标
                        nCode = 13;
                        ClientHeroAttack(M2Share.ActorsSystem.Get(ProcessMsg.nParam1), ProcessMsg.nParam2, ProcessMsg.nParam3);
                        break;
                    case Grobal2.CM_QUERYUSERLEVELSORT:// 用户排名
                        nCode = 14;
                        ClientGetUserOrder(ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3);
                        break;
                    case Grobal2.CM_OPENSHOP:
                        // ---------------------------商铺---------------------------------------------
                        // 打开商铺
                        nCode = 277;
                        ClientGetShopItemList(ProcessMsg.nParam2, ProcessMsg.nParam3);
                        break;
                    case Grobal2.RM_OPENSHOP:// 打开商铺
                        nCode = 278;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SENGSHOPITEMS, ProcessMsg.wParam, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_OPENSHOPSpecially:
                        nCode = 279;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SENGSHOPSPECIALLYITEMS, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_BUYSHOPITEM:// //购买商铺物品
                        nCode = 280;
                        if (HUtil32.GetTickCount() - m_dwUserTick[1] >= 500)
                        {
                            m_dwUserTick[1] = HUtil32.GetTickCount();
                            ClientBuyShopItem(ProcessMsg.sMsg);
                        }
                        else
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_EXCHANGEGAMEGIRD_FAIL, 0, 0, 0, 0, 0);
                            SendSocket(this.m_DefMsg, EncryptUnit.EncodeString("[失败]购买速度过快!"));
                        }
                        break;
                    case Grobal2.RM_BUYSHOPITEM_FAIL:// 购买商铺物品失败
                        nCode = 281;
                        switch (ProcessMsg.nParam1)
                        {
                            case 1:
                                ProcessMsg.sMsg = "[失败]你的 " + M2Share.g_Config.sGameGoldName + " 不够无法购买 " + ProcessMsg.sMsg;
                                break;
                            case 2:
                                ProcessMsg.sMsg = "[失败]你的包裹已满，请清理后在购买 " + ProcessMsg.sMsg;
                                break;
                            case 3:
                                ProcessMsg.sMsg = "[失败]没有找到 " + ProcessMsg.sMsg;
                                break;
                        }
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_BUYSHOPITEM_FAIL, 0, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeString(ProcessMsg.sMsg));
                        break;
                    case Grobal2.CM_BUYSHOPITEMGIVE:// 商铺赠送
                        nCode = 282;
                        if (HUtil32.GetTickCount() - m_dwUserTick[1] >= 500)
                        {
                            m_dwUserTick[1] = HUtil32.GetTickCount();
                            ClientBuyShopItemGive(ProcessMsg.sMsg);
                        }
                        else
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_EXCHANGEGAMEGIRD_FAIL, 0, 0, 0, 0, 0);
                            SendSocket(this.m_DefMsg, EncryptUnit.EncodeString("[失败]赠送速度过快!"));
                        }
                        break;
                    case Grobal2.RM_BUYSHOPITEMGIVE_SUCCESS:// 商铺赠送成功
                        nCode = 283;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_BUYSHOPITEMGIVE_SUCCESS, 0, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeString(ProcessMsg.sMsg));
                        break;
                    case Grobal2.RM_BUYSHOPITEMGIVE_FAIL:// 商铺赠送失败
                        nCode = 284;
                        switch (ProcessMsg.nParam1)
                        {
                            case 1:
                                ProcessMsg.sMsg = "[失败]你的 " + M2Share.g_Config.sGameGoldName + " 不够无法赠送 " + ProcessMsg.sMsg;
                                break;
                            case 2:
                                ProcessMsg.sMsg = "[失败]没有找到 " + ProcessMsg.sMsg;
                                break;
                            case 3:
                                ProcessMsg.sMsg = "[失败]你朋友的包裹已满，请通知你朋友清理后在购赠送 " + ProcessMsg.sMsg;
                                break;
                            case 4:
                                ProcessMsg.sMsg = "[失败]你的朋友 " + ProcessMsg.sMsg + " 没有在线！";
                                break;
                        }
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_BUYSHOPITEMGIVE_FAIL, 0, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeString(ProcessMsg.sMsg));
                        break;
                    case Grobal2.CM_EXCHANGEGAMEGIRD:// 兑换灵符
                        nCode = 285;
                        if (HUtil32.GetTickCount() - m_dwUserTick[1] >= 500)
                        {
                            m_dwUserTick[1] = HUtil32.GetTickCount();
                            ClientExchangeGameGird(ProcessMsg.nParam2);
                        }
                        else
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_EXCHANGEGAMEGIRD_FAIL, 0, 0, 0, 0, 0);
                            SendSocket(m_DefMsg, EncryptUnit.EncodeString("[失败]兑换过快!"));
                            SendSocket(this.m_DefMsg, EncryptUnit.EncodeString("[失败]兑换过快!"));
                        }
                        break;
                    case Grobal2.RM_EXCHANGEGAMEGIRD_SUCCESS:// 兑换灵符成功
                        nCode = 287;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_EXCHANGEGAMEGIRD_SUCCESS, 0, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeString(ProcessMsg.sMsg));
                        break;
                    case Grobal2.RM_EXCHANGEGAMEGIRD_FAIL:// 兑换灵符失败
                        nCode = 286;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_EXCHANGEGAMEGIRD_FAIL, 0, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeString(ProcessMsg.sMsg));
                        break;
                    case Grobal2.CM_HERODROPITEM:
                        // ---------------------------------------------------------------------------
                        nCode = 15;
                        if (m_MyHero != null)
                        {
                            if (((THeroObject)(m_MyHero)).ClientDropItem(ProcessMsg.sMsg, ProcessMsg.nParam1))
                            {
                                SendDefMessage(Grobal2.SM_HERODROPITEM_SUCCESS, ProcessMsg.nParam1, 0, 0, 0, ProcessMsg.sMsg);
                            }
                            else
                            {
                                SendDefMessage(Grobal2.SM_HERODROPITEM_FAIL, ProcessMsg.nParam1, 0, 0, 0, ProcessMsg.sMsg);
                            }
                        }
                        break;
                    case Grobal2.CM_HEROGOTETHERUSESPELL:// 接收到客户传来发合击的消息
                        nCode = 16;
                        if (m_MyHero != null)
                        {
                            ClientHeroUseSpell();
                        }
                        break;
                    case Grobal2.CM_REPAIRFIRDRAGON:// 修补火龙之心
                        nCode = 17;
                        if (m_MyHero != null)
                        {
                            ((THeroObject)(m_MyHero)).RepairFirDragon((byte)ProcessMsg.nParam2, ProcessMsg.nParam1, ProcessMsg.sMsg);
                        }
                        break;
                    case Grobal2.CM_REPAIRDRAGON:// 祝福罐.魔令包功能
                        nCode = 18;
                        RepairDragon((byte)ProcessMsg.nParam2, ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_REPAIRFINEITEM:// 修补火云石
                        nCode = 19;
                        RepairRefineItem(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_OPENBOXS:// 打开宝箱 清清
                        nCode = 20;
                        ClientSendBoxItem(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_MOVEBOXS:
                        nCode = 21;
                        ClientGetBoxs();
                        break;
                    case Grobal2.CM_GETBOXS:
                        nCode = 22;
                        ClientGetBoxsItme();
                        break;
                    case Grobal2.CM_SELGETHERO://酒馆 取回英雄 
                        nCode = 23;
                        ClientGETHERO(ProcessMsg.sMsg, (byte)ProcessMsg.nParam1);
                        break;
                    case Grobal2.CM_USERPLAYDRINKITEM:
                        nCode = 24;
                        ClientPlayDrinkItem(ProcessMsg.nParam1, HUtil32.MakeLong(ProcessMsg.nParam2, ProcessMsg.nParam3), ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_PlAYDRINKGAME:// 猜拳码数
                        nCode = 25;
                        ClientPlayDrinkToDrink(ProcessMsg.nParam1, (byte)ProcessMsg.nParam2);
                        break;
                    case Grobal2.CM_DrinkUpdateValue:// 改变酒精度
                        nCode = 26;
                        ClientDrinkUpdateValue(ProcessMsg.nParam1, (byte)ProcessMsg.nParam2, (byte)ProcessMsg.nParam3);
                        break;
                    case Grobal2.CM_USERPLAYDRINK:// 请酒
                        nCode = 27;
                        ClientPlayDrink(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_BEGINMAKEWINE:
                        // -------------------------酿酒系统---------------------------------------------
                        // 开始酿酒(即把材料全放上窗口)
                        nCode = 28;
                        ClientPlayMakeWine((byte)ProcessMsg.wParam, ProcessMsg.sMsg);// 为物品ID号
                        break;
                    case Grobal2.RM_GETBOXS:
                        // ------------------------------------------------------------------------------
                        nCode = 29;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_GETBOXS, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_MOVEBOXS:
                        nCode = 30;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_MOVEBOXS, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_OPENBOXS_FAIL:
                        nCode = 31;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENBOXS_FAIL, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SELLOFFCANCEL:// 元宝寄售取消出售
                        nCode = 32;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SellOffCANCEL, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SELLOFFADDITEM_OK:// 客户端往出售物品窗口里加物品 成功
                        nCode = 33;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SELLOFFADDITEM_OK, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SellOffADDITEM_FAIL:// 客户端往出售物品窗口里加物品 失败
                        nCode = 34;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SellOffADDITEM_FAIL, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SELLOFFDELITEM_OK:// 客户端删除出售物品窗里的物品 成功
                        nCode = 35;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SELLOFFDELITEM_OK, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SELLOFFDELITEM_FAIL:// 客户端删除出售物品窗里的物品 失败
                        nCode = 36;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SELLOFFDELITEM_FAIL, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SELLOFFEND_OK:// 客户端元宝寄售结束 成功
                        nCode = 37;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SELLOFFEND_OK, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SELLOFFEND_FAIL:// 客户端元宝寄售结束 失败
                        nCode = 38;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SELLOFFEND_FAIL, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SELLOFFBUY_OK:// 购买成功
                        nCode = 39;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SELLOFFBUY_OK, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_OPENBOXS:// 打开宝箱
                        nCode = 40;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENBOXS, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_OPENDRAGONBOXS:// 卧龙开宝箱
                        nCode = 41;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENDRAGONBOXS, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_QUERYREFINEITEM:// NPC打开淬炼窗口
                        nCode = 42;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_QUERYREFINEITEM, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_HEROWINEXP:
                        nCode = 43;
                        if (((THeroObject)(m_MyHero)) != null)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROWINEXP, (int)((THeroObject)(m_MyHero)).m_Abil.Exp,
                                HUtil32.LoWord(ProcessMsg.nParam1), HUtil32.HiWord(ProcessMsg.nParam1), 0, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_HEROLEVELUP:// 英雄升级
                        nCode = 44;
                        if (m_MyHero != null)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROLEVELUP, (int)m_MyHero.m_Abil.Exp, m_MyHero.m_Abil.Level, 0, 0, 0);
                            SendSocket(this.m_DefMsg, "");
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROABILITY, m_MyHero.m_btGender, 0, m_MyHero.m_btJob, ((THeroObject)(m_MyHero)).m_nLoyal, 0);
                            var sSendMsg = EncryptUnit.EncodeBuffer(this.m_WAbil);
                            SendSocket(this.m_DefMsg, sSendMsg);
                            SendDefMessage(Grobal2.SM_HEROSUBABILITY, HUtil32.MakeLong(HUtil32.MakeWord((byte)m_MyHero.m_nAntiMagic, 0), 0),
                                HUtil32.MakeWord(m_MyHero.m_btHitPoint, m_MyHero.m_btSpeedPoint), HUtil32.MakeWord((byte)m_MyHero.m_btAntiPoison, (byte)m_MyHero.m_nPoisonRecover),
                                HUtil32.MakeWord((byte)m_MyHero.m_nHealthRecover, (byte)m_MyHero.m_nSpellRecover), "");
                        }
                        break;
                    case Grobal2.RM_HEROABILITY:
                        nCode = 45;
                        if (m_MyHero != null)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROABILITY, m_MyHero.m_btGender, 0, m_MyHero.m_btJob, ((THeroObject)(m_MyHero)).m_nLoyal, 0);
                            var sSendMsg = EncryptUnit.EncodeBuffer(this.m_WAbil);
                            SendSocket(this.m_DefMsg, sSendMsg);
                        }
                        break;
                    case Grobal2.RM_RECALLHERO:// 召唤英雄
                        nCode = 46;
                        SendDefMessage(Grobal2.SM_RECALLHERO, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_CREATEHERO:// 创建英雄
                        nCode = 47;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_CREATEHERO, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                        var heroBaseObject = M2Share.ActorsSystem.Get(ProcessMsg.BaseObject);
                        CharDesc = new TCharDesc();
                        CharDesc.feature = heroBaseObject.GetFeature(this);
                        CharDesc.Status = heroBaseObject.m_nCharStatus;
                        CharDesc.Opature = heroBaseObject.GetFeatureJob();
                        CharDesc.Level = heroBaseObject.m_WAbil.Level;         //20191229
                        CharDesc.HP = heroBaseObject.m_WAbil.HP;               //20191229
                        CharDesc.MaxHP = heroBaseObject.m_WAbil.MaxHP;         //20191229
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(CharDesc));
                        break;
                    case Grobal2.RM_DESTROYHERO:// 英雄销毁
                        nCode = 48;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_DESTROYHERO, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_MAKEGHOSTHERO:
                        nCode = 49;
                        if (m_MyHero != null)
                        {
                            m_MyHero.m_boDeath = true;
                            m_MyHero.m_dwDeathTick = HUtil32.GetTickCount();
                            m_MyHero.MakeGhost();
                            m_MyHero = null;
                        }
                        break;
                    case Grobal2.RM_SENDHEROUSEITEMS:// 发送英雄身上装备
                        nCode = 50;
                        if (m_MyHero != null)
                        {
                            ((THeroObject)(m_MyHero)).SendUseitems();
                        }
                        break;
                    case Grobal2.RM_HEROWEIGHTCHANGED:
                        nCode = 51;
                        if (m_MyHero == null)
                        {
                            return result;
                        }
                        SendDefMessage(Grobal2.SM_HEROWEIGHTCHANGED, m_MyHero.m_WAbil.Weight, m_MyHero.m_WAbil.WearWeight, m_MyHero.m_WAbil.HandWeight, 0, "");
                        break;
                    case Grobal2.RM_HERODEATH:// 英雄死亡
                        nCode = 52;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HERODEATH, ProcessMsg.BaseObject, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_SENDHEROMYMAGIC:// 发送英雄所学的技能
                        nCode = 53;
                        if (m_MyHero != null)
                        {
                            ((THeroObject)(m_MyHero)).SendUseMagic();
                        }
                        break;
                    case Grobal2.RM_QUERYHEROBAGCOUNT:
                        nCode = 54;
                        SendDefMessage(Grobal2.SM_QUERYHEROBAGCOUNT, ProcessMsg.nParam1, ProcessMsg.nParam2, HUtil32.LoWord(ProcessMsg.nParam3), HUtil32.HiWord(ProcessMsg.nParam3), "");
                        break;
                    case Grobal2.RM_HEROMAGIC_LVEXP:// 英雄魔法升级
                        nCode = 55;
                        SendDefMessage(Grobal2.SM_HEROMAGIC_LVEXP, ProcessMsg.nParam1, ProcessMsg.nParam2, HUtil32.LoWord(ProcessMsg.nParam3), HUtil32.HiWord(ProcessMsg.nParam3), "");
                        break;
                    case Grobal2.RM_HEROSUBABILITY:
                        nCode = 56;
                        if (m_MyHero != null)
                        {
                            SendDefMessage(Grobal2.SM_HEROSUBABILITY, HUtil32.MakeLong(HUtil32.MakeWord((byte)m_MyHero.m_nAntiMagic, 0), 0),
                                HUtil32.MakeWord(m_MyHero.m_btHitPoint, m_MyHero.m_btSpeedPoint), HUtil32.MakeWord((byte)m_MyHero.m_btAntiPoison, (byte)m_MyHero.m_nPoisonRecover),
                                HUtil32.MakeWord((byte)m_MyHero.m_nHealthRecover, (byte)m_MyHero.m_nSpellRecover), "");
                        }
                        break;
                    case Grobal2.CM_QUERYUSERNAME:// 80
                        nCode = 57;
                        ClientQueryUserName(M2Share.ActorsSystem.Get(ProcessMsg.nParam1), ProcessMsg.nParam2, ProcessMsg.nParam3);
                        break;
                    case Grobal2.CM_QUERYBAGITEMS:// 刷新人物的包裹物品
                        nCode = 58;
                        ClientQueryBagItems();
                        break;
                    case Grobal2.CM_QUERYUSERSTATE:// 查看角色装备
                        nCode = 59;
                        ClientQueryUserState(M2Share.ActorsSystem.Get(ProcessMsg.nParam1), ProcessMsg.nParam2, ProcessMsg.nParam3);
                        break;
                    case Grobal2.CM_DROPITEM:// 丢弃物品消息
                        nCode = 61;
                        if (ClientDropItem(ProcessMsg.sMsg, ProcessMsg.nParam1))
                        {
                            SendDefMessage(Grobal2.SM_DROPITEM_SUCCESS, ProcessMsg.nParam1, 0, 0, 0, ProcessMsg.sMsg);
                        }
                        else
                        {
                            SendDefMessage(Grobal2.SM_DROPITEM_FAIL, ProcessMsg.nParam1, 0, 0, 0, ProcessMsg.sMsg);
                        }
                        break;
                    case Grobal2.CM_PICKUP:// 拾取物品消息
                        nCode = 62;
                        if ((this.m_nCurrX == ProcessMsg.nParam2) && (this.m_nCurrY == ProcessMsg.nParam3))
                        {
                            ClientPickUpItem();
                        }
                        break;
                    case Grobal2.CM_OPENDOOR:// 开门,人物走到地图的某个过门点时
                        nCode = 63;
                        ClientOpenDoor(ProcessMsg.nParam2, ProcessMsg.nParam3);
                        break;
                    case Grobal2.CM_TAKEONITEM:// 1003 从包裹里穿装备
                        nCode = 64;
                        ClientTakeOnItems((byte)ProcessMsg.nParam2, ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_TAKEOFFITEM:// 1004
                        nCode = 65;
                        ClientTakeOffItems((byte)ProcessMsg.nParam2, ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_EAT:// 1006
                        nCode = 66;
                        ClientUseItems(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_MAGICKEYCHANGE:// 客户端改变魔法快键
                        nCode = 68;
                        ClientChangeMagicKey(ProcessMsg.nParam1, ProcessMsg.nParam2);
                        break;
                    case Grobal2.CM_SOFTCLOSE:// 人物小退
                        nCode = 69;
                        this.m_LastHiter = null;
                        M2Share.UserEngine.SaveHumanRcd(this);// 保存人物数据
                        if (m_MyHero != null)//人物小退后，英雄直接消失
                        {
                            M2Share.UserEngine.SaveHeroRcd(this);// 保存英雄数据
                            m_MyHero.m_boDeath = true;
                            ((THeroObject)(m_MyHero)).boCallLogOut = true;// 英雄正常退出
                            m_MyHero.m_dwDeathTick = HUtil32.GetTickCount();
                            m_MyHero.MakeGhost();
                            m_MyHero = null;
                        }
                        m_boReconnection = true;
                        m_boSoftClose = true;
                        break;
                    case Grobal2.CM_CLICKNPC:
                        nCode = 70;
                        ClientClickNPC(ProcessMsg.nParam1);
                        break;
                    case Grobal2.CM_MERCHANTDLGSELECT:
                        nCode = 71;
                        ClientMerchantDlgSelect(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_PlAYDRINKDLGSELECT:
                        nCode = 72;
                        ClientPlayDrinkLable(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_MERCHANTQUERYSELLPRICE:// 1012
                        nCode = 73;
                        ClientMerchantQuerySellPrice(ProcessMsg.nParam1, HUtil32.MakeLong(ProcessMsg.nParam2, ProcessMsg.nParam3), ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_USERSELLITEM:// 1013
                        nCode = 74;
                        ClientUserSellItem(ProcessMsg.nParam1, HUtil32.MakeLong(ProcessMsg.nParam2, ProcessMsg.nParam3), ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_USERBUYITEM:// 1014
                        nCode = 75;
                        ClientUserBuyItem(ProcessMsg.wIdent, ProcessMsg.nParam1, HUtil32.MakeLong(ProcessMsg.nParam2, ProcessMsg.nParam3), 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_USERGETDETAILITEM:
                        // /////////////////////////增加拍卖////////////////////////////////////////////////////////
                        nCode = 76;
                        ClientUserBuyItem(ProcessMsg.wIdent, ProcessMsg.nParam1, 0, ProcessMsg.nParam2, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_DROPGOLD:
                        nCode = 77;
                        if (ProcessMsg.nParam1 > 0)
                        {
                            ClientDropGold(ProcessMsg.nParam1);
                        }
                        break;
                    case Grobal2.CM_1017:
                        nCode = 78;
                        SendDefMessage(1, 0, 0, 0, 0, "");
                        break;
                    case Grobal2.CM_GROUPMODE:// 关闭组队
                        nCode = 79;
                        if (ProcessMsg.nParam2 == 0) { ClientGropuClose(); } else { m_boAllowGroup = true; }
                        if (m_boAllowGroup)
                        {
                            SendDefMessage(Grobal2.SM_GROUPMODECHANGED, 0, 1, 0, 0, "");
                        }
                        else
                        {
                            SendDefMessage(Grobal2.SM_GROUPMODECHANGED, 0, 0, 0, 0, "");
                        }
                        break;
                    case Grobal2.CM_CREATEGROUP:// 1020 新建组队
                        nCode = 80;
                        ClientCreateGroup(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_ADDGROUPMEMBER:// 1021 增加组队人员
                        nCode = 81;
                        ClientAddGroupMember(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_DELGROUPMEMBER:// 1022
                        nCode = 82;
                        ClientDelGroupMember(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_USERREPAIRITEM:// 1023
                        nCode = 83;
                        ClientRepairItem(ProcessMsg.nParam1, HUtil32.MakeLong(ProcessMsg.nParam2, ProcessMsg.nParam3), ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_MERCHANTQUERYREPAIRCOST:// 1024
                        nCode = 84;
                        ClientQueryRepairCost(ProcessMsg.nParam1, HUtil32.MakeLong(ProcessMsg.nParam2, ProcessMsg.nParam3), ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_CLICKSIGHICON:
                        nCode = 293;
                        M2Share.CommandSystem.ExecCmd("@UserCmd " + ProcessMsg.sMsg, this);
                        //CmdUserCmd(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_CLICKCRYSTALEXPTOP:// 跳转到QF脚本段
                        nCode = 296;
                        ClientGetExpCrystalData();
                        break;
                    case Grobal2.CM_DEALTRY:// 客户端点击天地结晶，返回经验等信息
                        // ---------------------交易系统--------------------------------------------
                        // 1025 玩家点交易按键
                        nCode = 85;
                        ClientDealTry(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_DEALADDITEM:// 1026 玩家把物品放到交易框中
                        nCode = 86;
                        ClientAddDealItem(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_DEALDELITEM:// 1027 玩家从交易框中取回物品
                        nCode = 87;
                        ClientDelDealItem(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_DEALCANCEL:// 1028 玩家取消交易
                        nCode = 88;
                        ClientCancelDeal();
                        break;
                    case Grobal2.CM_DEALCHGGOLD:// 1029 客户端把金币放到交易框中
                        nCode = 89;
                        ClientChangeDealGold(ProcessMsg.nParam1);
                        break;
                    case Grobal2.CM_DEALEND:// 1030 交易结束
                        nCode = 90;
                        ClientDealEnd();
                        break;
                    // ---------------------------挑战系统--------------------------------
                    case Grobal2.CM_CHALLENGETRY:// 玩家点击挑战
                        nCode = 91;
                        ClientChallenge();
                        break;
                    case Grobal2.CM_CHALLENGEADDITEM:// 玩家把物品放到挑战框中
                        nCode = 92;
                        ClientAddChallengeItem(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_CHALLENGEDELITEM:// 玩家从挑战框中取回物品
                        nCode = 93;
                        ClientDelChallengeItem(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_CHALLENGECANCEL:// 玩家取消挑战
                        nCode = 94;
                        ClientCancelChallenge();
                        break;
                    case Grobal2.CM_CHALLENGECHGGOLD:// 客户端把金币放到挑战框中
                        nCode = 95;
                        ClientChangeChallengeGold(ProcessMsg.nParam1);
                        break;
                    case Grobal2.CM_CHALLENGECHGDIAMOND:// 客户端把金刚石放到挑战框中
                        nCode = 96;
                        ClientChangeChallengeDIAMOND(ProcessMsg.nParam1);
                        break;
                    case Grobal2.CM_CHALLENGEEND:// 挑战抵押物品结束
                        nCode = 97;
                        ClientChallengeEnd();
                        break;
                    case Grobal2.CM_SELLOFFADDITEM:
                        // ==========================元宝寄售系统======================================
                        // 客户端往出售物品窗口里加物品 
                        nCode = 98;
                        ClientAddSellOffItem(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_SELLOFFDELITEM:// 客户端删除出售物品窗里的物品 
                        nCode = 99;
                        ClientDelSellOffItem(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_SELLOFFCANCEL:// 客户端取消元宝寄售 
                        nCode = 100;
                        ClientCancelSellOff();
                        break;
                    case Grobal2.CM_SELLOFFEND:// 客户端元宝寄售结束
                        nCode = 101;// 买方// 元宝数// 金刚石数// 金刚石特征,类型上限表示
                        ClientSellOffEnd(ProcessMsg.sMsg, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3);
                        break;
                    case Grobal2.CM_CANCELSELLOFFITEMING:// 取消正在寄售的物品 (出售人)
                        nCode = 102;
                        ClientCancelSellOffIng();
                        break;
                    case Grobal2.CM_SELLOFFBUYCANCEL:// 取消寄售 物品购买 (购买人)
                        nCode = 103;// 出售人
                        ClientBuyCancelSellOff(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_SELLOFFBUY:// 确定购买寄售物品 
                        nCode = 104;// 出售人
                        ClientBuySellOffItme(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_REFINEITEM:
                        // ============================================================================
                        // 客户端发送粹练物品
                        nCode = 105;
                        if (ClientAddRefineItem(ProcessMsg.sMsg))
                        {
                            ClientRefineItem();
                        }
                        break;
                    case Grobal2.CM_USERSTORAGEITEM:// 1031
                        nCode = 106;
                        ClientStorageItem(ProcessMsg.nParam1, HUtil32.MakeLong(ProcessMsg.nParam2, ProcessMsg.nParam3), ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_USERTAKEBACKSTORAGEITEM:// 1032
                        nCode = 107;
                        ClientTakeBackStorageItem(ProcessMsg.nParam1, HUtil32.MakeLong(ProcessMsg.nParam2, ProcessMsg.nParam3), ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_WANTMINIMAP:// 1033
                        nCode = 108;
                        ClientGetMinMap();
                        break;
                    case Grobal2.CM_USERMAKEDRUGITEM:// 1034
                        nCode = 109;
                        ClientMakeDrugItem(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_OPENGUILDDLG:// 1035
                        nCode = 110;
                        ClientOpenGuildDlg();
                        break;
                    case Grobal2.CM_GUILDHOME:// 1036
                        nCode = 111;
                        ClientGuildHome();
                        break;
                    case Grobal2.CM_GUILDMEMBERLIST:
                        nCode = 112;
                        ClientGuildMemberList();
                        break;
                    case Grobal2.CM_GUILDADDMEMBER:
                        nCode = 113;
                        ClientGuildAddMember(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_GUILDDELMEMBER:
                        nCode = 114;
                        ClientGuildDelMember(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_GUILDUPDATENOTICE:
                        nCode = 115;
                        ClientGuildUpdateNotice(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_GUILDUPDATERANKINFO:// 1041 修改行会成员封号,等级
                        nCode = 116;
                        ClientGuildUpdateRankInfo(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_1042:
                        M2Share.MainOutMessage("[非法数据] " + this.m_sCharName);
                        break;
                    case Grobal2.CM_ADJUST_BONUS:
                        nCode = 117;
                        ClientAdjustBonus(ProcessMsg.nParam1, ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_GUILDALLY:// 1044
                        nCode = 118;
                        ClientGuildAlly();
                        break;
                    case Grobal2.CM_GUILDBREAKALLY:// 1045
                        nCode = 119;
                        ClientGuildBreakAlly(ProcessMsg.sMsg);
                        break;
                    case Grobal2.CM_SAY:
                        nCode = 127;
                        if (ProcessMsg.sMsg != null && ProcessMsg.sMsg != "")
                        {
                            ProcessUserLineMsg(ProcessMsg.sMsg);
                        }
                        break;
                    case Grobal2.CM_USEBATTER:// 使用连击
                        nCode = 8828;
                        if (this.AllowBatterHitSkill(true))// 检测并且打开连击设置位True
                        {
                            this.m_nBatterTarget = M2Share.ActorsSystem.Get(ProcessMsg.nParam3);
                            this.m_nBatterX = ProcessMsg.nParam1;
                            this.m_nBatterY = ProcessMsg.nParam2;
                            this.m_nBatterDir = (byte)ProcessMsg.nParam3;
                            this.m_boBatterFinally = false;
                            this.m_nBatterUseTick = HUtil32.GetTickCount();
                            this.m_nBatter = 0;
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_BATTERSTART, 0, 0, 0, 0, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.CM_QUERYOPENPULSE:
                        ClientQueryOpenPulse((ushort)ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, false);
                        break;
                    case Grobal2.CM_QUERYHEROOPENPULSE:
                        ClientQueryOpenPulse((ushort)ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, true);
                        break;
                    case Grobal2.CM_OPENPULSE:
                        break;
                    case Grobal2.CM_RUSHPULSE:
                        ClientRushPulse((ushort)ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, false);
                        break;
                    case Grobal2.CM_RUSHHEROPULSE:
                        ClientRushPulse((ushort)ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, true);
                        break;
                    case Grobal2.CM_SETBATTERORDER:
                        this.m_nBatterOrder[0] = (byte)ProcessMsg.nParam2;
                        this.m_nBatterOrder[1] = (byte)ProcessMsg.nParam3;
                        this.m_nBatterOrder[2] = (byte)ProcessMsg.wParam;
                        break;
                    case Grobal2.CM_SETHEROBATTERORDER:
                        if (m_MyHero != null)
                        {
                            m_MyHero.m_nBatterOrder[0] = (byte)ProcessMsg.nParam2;
                            m_MyHero.m_nBatterOrder[1] = (byte)ProcessMsg.nParam3;
                            m_MyHero.m_nBatterOrder[2] = (byte)ProcessMsg.wParam;
                        }
                        break;
                    case Grobal2.CM_CHANGEHEROATTECTMODE:
                        // ==============双英雄相关=============================//
                        if (ProcessMsg.nParam2 >= 0 && ProcessMsg.nParam2 <= 2)
                        {
                            m_btDeputyHeroJob = (byte)ProcessMsg.nParam2;
                        }
                        break;
                    case Grobal2.CM_PASSWORD:
                        nCode = 128;
                        ProcessClientPassword(ProcessMsg);
                        break;
                    case Grobal2.CM_QUERYASSESSHERO:
                        nCode = 10001;
                        ClientQueryAssessHero();
                        break;
                    case Grobal2.CM_ASSESSMENTHERO:
                        nCode = 10002;
                        ClientAssessHero();
                        break;
                    case Grobal2.RM_PULSECHANGED:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_PULSECHANGED, 0, 0, 0, 0, ProcessMsg.nParam3);
                        //SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(this.m_HumPulses, sizeof(Grobal2.TBatterPulse)));
                        break;
                    case Grobal2.RM_HEROPULSECHANGED:
                        if (m_MyHero != null)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROPULSECHANGED, 0, 0, 0, 0, ProcessMsg.nParam3);
                            //SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(((THeroObject)(m_MyHero)).m_HumPulses, sizeof(Grobal2.TBatterPulse)));
                        }
                        break;
                    case Grobal2.RM_STORMSRATE:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_STORMSRATE, ProcessMsg.BaseObject, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_STORMSRATECHANGED:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_STORMSRATECHANGED, 0, 0, 0, 0, ProcessMsg.nParam3);
                        //SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(((this) as TPlayObject).m_HumStormsRate, sizeof(Grobal2.TStormsRate)));
                        break;
                    case Grobal2.RM_OPENPULSENEEDLEV:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENPULSENEEDLEV, 0, 0, 0, 0, ProcessMsg.nParam3);
                        //SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(((this) as TPlayObject).m_PulseNeedLev, 20));
                        break;
                    case Grobal2.RM_HEROSTORMSRATECHANGED:
                        if (m_MyHero != null)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROSTORMSRATECHANGED, 0, 0, 0, 0, ProcessMsg.nParam3);
                            //data = new byte[sizeof(TStormsRate)];
                            //fixed (byte* pb = data)
                            //{
                            //    *(TStormsRate*)pb = ((THeroObject)(m_MyHero)).m_HumStormsRate;
                            //}
                            //SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(data, sizeof(TStormsRate)));
                        }
                        break;
                    case Grobal2.RM_OPENPULSE_OK:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENPULSE_OK, 0, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_RUSHPULSE_OK:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_RUSHPULSE_OK, 0, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_OPENPULSE_FAIL:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENPULSE_FAIL, ProcessMsg.wParam, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_BATTERUSEFINALLY:
                        this.m_nBatterUseTick = HUtil32.GetTickCount();
                        this.SysMsg("连击技结束！！！", TMsgColor.c_Red, TMsgType.t_Hint);
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_BATTERUSEFINALLY, 0, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_RUSHPULSE_FAIL:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_RUSHPULSE_FAIL, ProcessMsg.wParam, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_BATTERORDER:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_BATTERORDER, 0, this.m_nBatterOrder[0], this.m_nBatterOrder[1], this.m_nBatterOrder[2], 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_HEROATTECTMODE:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROATTECTMODE, 0, m_btDeputyHeroJob, 0, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_HEROBATTERORDER:
                        if (m_MyHero != null)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROBATTERORDER, 0, ((THeroObject)(m_MyHero)).m_nBatterOrder[0], ((THeroObject)(m_MyHero)).m_nBatterOrder[1], ((THeroObject)(m_MyHero)).m_nBatterOrder[2], 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;

                    case Grobal2.RM_HIT:
                        nCode = 132;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_PIXINGHIT:// 劈星斩效果
                        nCode = 133;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_PIXINGHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_LEITINGHIT:// 雷霆一击效果
                        nCode = 134;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_LEITINGHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_HEAVYHIT:
                        nCode = 135;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEAVYHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        }
                        break;
                    case Grobal2.RM_BIGHIT:
                        nCode = 136;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_BIGHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_SPELL2:// 10008
                        nCode = 138;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_POWERHIT, ProcessMsg.BaseObject,
                                ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_MOVEFAIL:
                        nCode = 139;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_MOVEFAIL, this.m_ActorsId,
                            this.m_nCurrX, this.m_nCurrY, this.m_btDirection, 0);
                        var moveBaseObject = M2Share.ActorsSystem.Get(ProcessMsg.BaseObject);
                        CharDesc = new TCharDesc();
                        CharDesc.feature = moveBaseObject.GetFeatureToLong();
                        CharDesc.Status = moveBaseObject.m_nCharStatus;
                        CharDesc.Opature = moveBaseObject.GetFeatureJob();
                        CharDesc.Level = moveBaseObject.m_WAbil.Level;         //20191229
                        CharDesc.HP = moveBaseObject.m_WAbil.HP;               //20191229
                        CharDesc.MaxHP = moveBaseObject.m_WAbil.MaxHP;         //20191229
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(CharDesc));
                        break;
                    case Grobal2.RM_LONGHIT:// 10011 刺杀
                        nCode = 140;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_LONGHIT, ProcessMsg.BaseObject,
                                ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_WIDEHIT:// 10012 半月
                        nCode = 141;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_WIDEHIT, ProcessMsg.BaseObject,
                                ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_DAILY:// 逐日剑法
                        nCode = 142;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_DAILY, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_FIREHIT:// 烈火
                        nCode = 143;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_FIREHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_4FIREHIT:// 4级烈火
                        nCode = 144;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_4FIREHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_4LONGHIT:// 四级刺杀
                        nCode = 144;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_4LONGHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_YUANYUEHIT:// 圆月弯刀
                        nCode = 144;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_YUANYUEHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_CRSHIT:// 抱月刀
                        nCode = 145;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_CRSHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_41:// 开天斩
                        nCode = 146;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            switch (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject).m_n42kill)
                            {
                                case 1:// 开天斩重轻击
                                    this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_QTWINHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                        ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                                    break;
                                case 2:
                                    this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_TWINHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                        ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                                    break;
                            }
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_42:// 42
                        nCode = 147;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_42, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_43:// 43
                        nCode = 148;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_43, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_44://龙影剑法
                        nCode = 149;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_CIDHIT, ProcessMsg.BaseObject,
                                ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_MONMOVE:// 擒拿手
                        nCode = 150;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SITDOWN, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                                ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_SANJUEHIT:// 三绝杀
                        nCode = 150;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SANJUEHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_ZHUIXINHIT:// 追心刺
                        nCode = 150;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_ZHUIXINHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, ProcessMsg.nParam3);
                            SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(HUtil32.IntToObject<TPlayObject>(ProcessMsg.BaseObject).m_nBatterZhuiXin));
                        }
                        break;
                    case Grobal2.RM_DUANYUEHIT:// 断岳斩
                        nCode = 150;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_DUANYUEHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_HENGSAOHIT:// 横扫千军
                        nCode = 150;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HENGSAOHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_YTPDHIT:// 倚天劈地
                        nCode = 150;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_YTPDHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_XPYJHIT:// 血魄一击 为不打乱ncode的连续，这儿没有设计改变ncode的值
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) != this)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_XPYJHIT, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                            SendSocket(this.m_DefMsg, "");
                        }
                        break;
                    case Grobal2.RM_ZHUIXIN_OK:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_ZHUIXIN_OK, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_GOTETHERUSESPELL:
                        nCode = 151;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_GOTETHERUSESPELL, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_DISAPPEAR:
                        nCode = 157;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_DISAPPEAR, ProcessMsg.BaseObject, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_SKELETON:// 10024
                        nCode = 158;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SKELETON, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                        var skeleotnBaseObjece = M2Share.ActorsSystem.Get(ProcessMsg.BaseObject);
                        CharDesc = new TCharDesc();
                        CharDesc.feature = skeleotnBaseObjece.GetFeature(this);
                        CharDesc.Status = skeleotnBaseObjece.m_nCharStatus;

                        CharDesc.Opature = skeleotnBaseObjece.GetFeatureJob();
                        CharDesc.Level = skeleotnBaseObjece.m_WAbil.Level;         //20191229
                        CharDesc.HP = skeleotnBaseObjece.m_WAbil.HP;               //20191229
                        CharDesc.MaxHP = skeleotnBaseObjece.m_WAbil.MaxHP;         //20191229
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(CharDesc));
                        break;
                    case Grobal2.RM_USERNAME:
                        nCode = 159;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_USERNAME, ProcessMsg.BaseObject,
                            this.GetCharColor(M2Share.ActorsSystem.Get(ProcessMsg.BaseObject)), ProcessMsg.nParam3, 0, 0);
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeString(ProcessMsg.sMsg));
                        break;
                    case Grobal2.RM_WINEXP:
                        nCode = 160;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_WINEXP, this.m_Abil.Exp, HUtil32.LoWord(ProcessMsg.nParam1), HUtil32.HiWord(ProcessMsg.nParam1), 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_WINNHEXP:// 取得内功经验
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_WINNHEXP, 0, HUtil32.LoWord(ProcessMsg.nParam1), HUtil32.HiWord(ProcessMsg.nParam1), 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_HEROWINNHEXP:// 英雄取得内功经验
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROWINNHEXP, 0, HUtil32.LoWord(ProcessMsg.nParam1), HUtil32.HiWord(ProcessMsg.nParam1), 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_CHANGENAMECOLOR:// 10046 改变名字颜色
                        nCode = 162;
                        if (ProcessMsg.BaseObject != 0)
                        {
                            SendDefMessage(Grobal2.SM_CHANGENAMECOLOR, ProcessMsg.BaseObject, this.GetCharColor(M2Share.ActorsSystem.Get(ProcessMsg.BaseObject)), 0, 0, "");
                        }
                        break;
                    case Grobal2.RM_PLAYMAKEWINEABILITY:// 酒2相关属性
                        nCode = 266;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_PLAYMAKEWINEABILITY, this.m_WAbil.Alcohol, this.m_WAbil.MaxAlcohol, this.m_WAbil.WineDrinkValue, this.m_WAbil.MedicineValue, 0);
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeString((this.m_WAbil.MaxMedicineValue).ToString()));
                        break;
                    case Grobal2.RM_HEROMAKEWINEABILITY:// 英雄酒2相关属性
                        if (m_MyHero != null)
                        {
                            nCode = 267;
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROMAKEWINEABILITY, m_MyHero.m_WAbil.Alcohol, m_MyHero.m_WAbil.MaxAlcohol, m_MyHero.m_WAbil.WineDrinkValue, m_MyHero.m_WAbil.MedicineValue, 0);
                            SendSocket(this.m_DefMsg, EncryptUnit.EncodeString((m_MyHero.m_WAbil.MaxMedicineValue).ToString()));
                        }
                        break;
                    case Grobal2.RM_CANEXPLORATION:// 可探索
                        nCode = 268;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_CANEXPLORATION, this.m_ActorsId, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_HEALTHSPELLCHANGED:// 10052   攻击少血与此方法有一定关系
                        nCode = 166;
                        var BaseObject = M2Share.ActorsSystem.Get(ProcessMsg.BaseObject);
                        var Health = new THealth();
                        Health.HP = BaseObject.m_WAbil.HP;
                        Health.MP = BaseObject.m_WAbil.MP;
                        Health.MaxHP = BaseObject.m_WAbil.MaxHP;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEALTHSPELLCHANGED, ProcessMsg.BaseObject, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(Health));
                        break;
                    case Grobal2.RM_ITEMSHOW:// 10110
                        nCode = 168;
                        SendDefMessage(Grobal2.SM_ITEMSHOW, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_ITEMHIDE:// 10111
                        nCode = 169;
                        SendDefMessage(Grobal2.SM_ITEMHIDE, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, 0, "");
                        break;
                    case Grobal2.RM_DOOROPEN:// 10112
                        nCode = 170;
                        SendDefMessage(Grobal2.SM_OPENDOOR_OK, 0, ProcessMsg.nParam1, ProcessMsg.nParam2, 0, "");
                        break;
                    case Grobal2.RM_DOORCLOSE:// 10113
                        nCode = 171;
                        SendDefMessage(Grobal2.SM_CLOSEDOOR, 0, ProcessMsg.nParam1, ProcessMsg.nParam2, 0, "");
                        break;
                    case Grobal2.RM_SENDUSEITEMS:
                        nCode = 172;
                        SendUseitems();
                        break;
                    case Grobal2.RM_WEIGHTCHANGED:// 10115 重量改变
                        nCode = 173;
                        SendDefMessage(Grobal2.SM_WEIGHTCHANGED, this.m_WAbil.Weight, this.m_WAbil.WearWeight, this.m_WAbil.HandWeight, 0, "");
                        break;
                    case Grobal2.RM_FEATURECHANGED:// 10116
                        nCode = 174;
                        SendDefMessage(Grobal2.SM_FEATURECHANGED, this.m_ActorsId, HUtil32.LoWord(ProcessMsg.nParam1),
                           HUtil32.HiWord(ProcessMsg.nParam1), ProcessMsg.wParam, "");
                        break;
                    case Grobal2.RM_CLEAROBJECTS:// 10117
                        nCode = 175;
                        SendDefMessage(Grobal2.SM_CLEAROBJECTS, 0, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_MAGICFIRE:// 10120
                        nCode = 178;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_MAGICFIRE, ProcessMsg.BaseObject, HUtil32.LoWord(ProcessMsg.nParam2),
                            HUtil32.HiWord(ProcessMsg.nParam2), ProcessMsg.nParam1, 0);
                        var data = new byte[sizeof(int)];
                        unsafe
                        {
                            fixed (byte* pb = data)
                            {
                                *(int*)pb = ProcessMsg.nParam3;
                            }
                        }
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeBuffer(data, sizeof(int)));
                        break;
                    case Grobal2.RM_MAGICFIREFAIL:// 10121
                        nCode = 179;
                        SendDefMessage(Grobal2.SM_MAGICFIRE_FAIL, ProcessMsg.BaseObject, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_SENDMYMAGIC:
                        nCode = 180;
                        SendUseMagic();
                        break;
                    case Grobal2.RM_MAGIC_LVEXP:// 10122
                        nCode = 181;
                        SendDefMessage(Grobal2.SM_MAGIC_LVEXP, ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, (ushort)HUtil32.LoWord(ProcessMsg.nParam3),
                            (ushort)HUtil32.HiWord(ProcessMsg.nParam3), "");
                        break;
                    case Grobal2.RM_DURACHANGE:// 10125
                        nCode = 182;
                        SendDefMessage(Grobal2.SM_DURACHANGE, ProcessMsg.nParam1, (ushort)ProcessMsg.wParam, (ushort)HUtil32.LoWord(ProcessMsg.nParam2),
                            (ushort)HUtil32.HiWord(ProcessMsg.nParam2), ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_EXPTIMEITEMS:// 聚灵珠 发送时间变化 
                        nCode = 183;// 时间
                        SendDefMessage(Grobal2.SM_EXPTIMEITEMS, ProcessMsg.nParam1, (ushort)ProcessMsg.wParam, (ushort)ProcessMsg.nParam2, 0, "");
                        break;
                    case Grobal2.RM_HERODURACHANGE:// 10125
                        nCode = 184;
                        SendDefMessage(Grobal2.SM_HERODURACHANGE, ProcessMsg.nParam1, (ushort)ProcessMsg.wParam, (ushort)HUtil32.LoWord(ProcessMsg.nParam2),
                            (ushort)HUtil32.HiWord(ProcessMsg.nParam2), "");
                        break;
                    case Grobal2.RM_FIRDRAGONPOINT:
                        nCode = 185;
                        SendDefMessage(Grobal2.SM_FIRDRAGONPOINT, ProcessMsg.nParam1, (ushort)ProcessMsg.wParam, 0, 0, "");
                        break;
                    case Grobal2.RM_MERCHANTDLGCLOSE:// 10127
                        nCode = 186;
                        SendDefMessage(Grobal2.SM_MERCHANTDLGCLOSE, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_SENDGOODSLIST:
                        nCode = 187;
                        SendDefMessage(Grobal2.SM_SENDGOODSLIST, ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, 0, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SENDUSERSELL:// 10129
                        nCode = 188;
                        SendDefMessage(Grobal2.SM_SENDUSERSELL, ProcessMsg.nParam1, ProcessMsg.nParam2, 0, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_CHANGEATTATCKMODE:
                        nCode = 189;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_CHANGEATTATCKMODE, this.m_ActorsId, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, EncryptUnit.EncodeString(ProcessMsg.sMsg));
                        break;
                    case Grobal2.RM_SENDBUYPRICE:// 10130
                        nCode = 190;
                        SendDefMessage(Grobal2.SM_SENDBUYPRICE, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_USERSELLITEM_OK:// 10131
                        nCode = 191;
                        SendDefMessage(Grobal2.SM_USERSELLITEM_OK, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_USERSELLITEM_FAIL:// 10132
                        nCode = 192;
                        SendDefMessage(Grobal2.SM_USERSELLITEM_FAIL, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_BUYITEM_SUCCESS:// 10133
                        nCode = 193;
                        SendDefMessage(Grobal2.SM_BUYITEM_SUCCESS, ProcessMsg.nParam1, HUtil32.LoWord(ProcessMsg.nParam2), HUtil32.HiWord(ProcessMsg.nParam2), 0, "");
                        break;
                    case Grobal2.RM_BUYITEM_FAIL:// 10134
                        nCode = 194;
                        SendDefMessage(Grobal2.SM_BUYITEM_FAIL, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_SENDDETAILGOODSLIST:// 10135
                        nCode = 195;
                        SendDefMessage(Grobal2.SM_SENDDETAILGOODSLIST, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_OPENBOOKS:// 卧龙
                        nCode = 196;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENBOOKS, ProcessMsg.BaseObject, ProcessMsg.nParam1, 0, 0, 0);// 10126
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_Browser:// 连接指定网址
                        nCode = 197;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_Browser, ProcessMsg.BaseObject, 0, 0, 0, 0);// 10126
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_AUTOGOTOXY:// 自动寻路
                        nCode = 198;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_AUTOGOTOXY, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, 0, 0);// 10126
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_OPENMAKEWINE:
                        // -------------------------酿酒系统---------------------------------------------
                        // 打开酿酒窗口
                        nCode = 199;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENMAKEWINE, ProcessMsg.BaseObject, ProcessMsg.nParam1, 0, 0, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_MAKEWINE_OK:// 酿酒成功
                        nCode = 200;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_MAKEWINE_OK, ProcessMsg.BaseObject, ProcessMsg.nParam1, 0, 0, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_MAKEWINE_FAIL:// 酿酒失败
                        nCode = 201;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_MAKEWINE_FAIL, ProcessMsg.BaseObject, ProcessMsg.nParam1, 0, 0, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_MAGIC68SKILLEXP:// 酒气护体技能经验
                        nCode = 203;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_MAGIC68SKILLEXP, ProcessMsg.BaseObject, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_HEROMAGIC68SKILLEXP:// 英雄酒气护体技能经验 
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROMAGIC68SKILLEXP, ProcessMsg.BaseObject, 0, 0, 0, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_MAGIC69SKILLEXP:// 内功心法经验
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_MAGIC69SKILLEXP, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                            ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_HEROMAGIC69SKILLEXP:// 英雄内功心法经验
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_HEROMAGIC69SKILLEXP, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                            ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_MAGIC69SKILLNH:// 内力值(黄条)
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_MAGIC69SKILLNH, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                            ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SENDSELLOFFGOODSLIST:
                        // ------------------------------------------------------------------------------
                        // ////////////////////////////////////拍卖//////////////////////////////////////
                        // 拍卖
                        nCode = 205;
                        SendDefMessage(Grobal2.SM_SENDSELLOFFGOODSLIST, ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, (ushort)ProcessMsg.nParam3, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SENDUSERSELLOFFITEM:
                        nCode = 206;
                        SendDefMessage(Grobal2.SM_SENDUSERSELLOFFITEM, ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, 0, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SENDUSERSELLOFFITEM_OK:
                        nCode = 207;
                        SendDefMessage(Grobal2.SM_SENDUSERSELLOFFITEM_OK, ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, (ushort)ProcessMsg.nParam3, 0, "");
                        break;
                    case Grobal2.RM_SENDUSERSELLOFFITEM_FAIL:
                        nCode = 208;
                        SendDefMessage(Grobal2.SM_SENDUSERSELLOFFITEM_FAIL, ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, (ushort)ProcessMsg.nParam3, 0, "");
                        break;
                    case Grobal2.RM_SENDSELLOFFITEMLIST:
                        nCode = 209;
                        SendDefMessage(Grobal2.CM_SENDSELLOFFITEMLIST, ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, (ushort)ProcessMsg.nParam3, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SENDBUYSELLOFFITEM_OK:// 购买拍卖物品成功
                        nCode = 210;
                        SendDefMessage(Grobal2.SM_SENDBUYSELLOFFITEM_OK, ProcessMsg.nParam1, (ushort)HUtil32.LoWord(ProcessMsg.nParam2),
                            (ushort)HUtil32.HiWord(ProcessMsg.nParam2), 0, "");
                        break;
                    case Grobal2.RM_SENDBUYSELLOFFITEM_FAIL:// 购买拍卖物品失败
                        nCode = 211;
                        SendDefMessage(Grobal2.SM_SENDBUYSELLOFFITEM_FAIL, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_HIDESIGHICON:// 隐藏感叹号图标
                        nCode = 294;
                        SendDefMessage(Grobal2.SM_HIDESIGHICON, 0, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_OPENEXPCRYSTAL:// 显示、隐藏天地结晶图标
                        nCode = 295;
                        SendDefMessage(Grobal2.SM_OPENEXPCRYSTAL, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_SENDDEALOFFFORM:
                        // ---------------------------元宝寄售系统---------------------------------------
                        // 打开出售物品窗口
                        nCode = 212;
                        SendDefMessage(Grobal2.SM_SENDDEALOFFFORM, ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, 0, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_QUERYYBSELL:// 查询正在出售的物品
                        nCode = 213;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_QUERYYBSELL, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_QUERYYBDEAL:// 查询可以的购买物品
                        nCode = 214;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_QUERYYBDEAL, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, ProcessMsg.wParam, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_GOLDCHANGED:// 10136
                        nCode = 215;
                        SendDefMessage(Grobal2.SM_GOLDCHANGED, this.m_nGold, HUtil32.LoWord(m_nGameGold), HUtil32.HiWord(m_nGameGold), 0, "");
                        break;
                    case Grobal2.RM_GAMEGOLDCHANGED:
                        nCode = 216;
                        SendGoldInfo(false);
                        break;
                    case Grobal2.RM_CHANGELIGHT:// 10137
                        nCode = 217;
                        SendDefMessage(Grobal2.SM_CHANGELIGHT, ProcessMsg.BaseObject, M2Share.ActorsSystem.Get(ProcessMsg.BaseObject).m_nLight, M2Share.g_Config.nClientKey, 0, "");
                        break;
                    case Grobal2.RM_LAMPCHANGEDURA:// 10138
                        nCode = 218;
                        SendDefMessage(Grobal2.SM_LAMPCHANGEDURA, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_CHARSTATUSCHANGED:// 10139
                        nCode = 219;
                        SendDefMessage(Grobal2.SM_CHARSTATUSCHANGED, ProcessMsg.BaseObject, HUtil32.LoWord(ProcessMsg.nParam1),
                            HUtil32.HiWord(ProcessMsg.nParam1), ProcessMsg.wParam, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_GROUPCANCEL:// 10140
                        nCode = 220;
                        SendDefMessage(Grobal2.SM_GROUPCANCEL, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_SENDUSERREPAIR:
                    case Grobal2.RM_SENDUSERSREPAIR:// 10141
                        nCode = 221;
                        SendDefMessage(Grobal2.SM_SENDUSERREPAIR, ProcessMsg.nParam1, ProcessMsg.nParam2, 0, 0, "");
                        break;
                    case Grobal2.RM_USERREPAIRITEM_OK:// 10143
                        nCode = 222;
                        SendDefMessage(Grobal2.SM_USERREPAIRITEM_OK, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, 0, "");
                        break;
                    case Grobal2.RM_SENDREPAIRCOST:// 10142
                        nCode = 223;
                        SendDefMessage(Grobal2.SM_SENDREPAIRCOST, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_USERREPAIRITEM_FAIL:// 10144
                        nCode = 224;
                        SendDefMessage(Grobal2.SM_USERREPAIRITEM_FAIL, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_USERSTORAGEITEM:// 10146
                        nCode = 225;
                        SendDefMessage(Grobal2.SM_SENDUSERSTORAGEITEM, ProcessMsg.nParam1, ProcessMsg.nParam2, 0, 0, "");
                        break;
                    case Grobal2.RM_USERGETBACKITEM:// 10147
                        nCode = 226;
                        SendSaveItemList(ProcessMsg.nParam1);
                        break;
                    case Grobal2.RM_USERBIGGETBACKITEM:// 发送无限仓库物品
                        nCode = 227;
                        SendSaveBigStorageItemList(ProcessMsg.nParam1, ProcessMsg.wParam);
                        break;
                    case Grobal2.RM_SENDDELITEMLIST:// 10148 SM_DELITEMS
                        nCode = 228;
                        if (M2Share.ActorsSystem.Get(ProcessMsg.BaseObject) == m_MyHero)
                        {
                            ((THeroObject)(m_MyHero)).SendDelItemList((List<string>)HUtil32.IntToObject<List<string>>(ProcessMsg.nParam1));
                        }
                        else
                        {
                            SendDelItemList((List<string>)HUtil32.IntToObject<List<string>>(ProcessMsg.nParam1));
                        }
                        Dispose((List<string>)HUtil32.IntToObject<List<string>>(ProcessMsg.nParam1));
                        break;
                    case Grobal2.RM_USERMAKEDRUGITEMLIST:// 10149
                        nCode = 229;
                        SendDefMessage(Grobal2.SM_SENDUSERMAKEDRUGITEMLIST, ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, 0, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_MAKEDRUG_SUCCESS:// 10150
                        nCode = 230;
                        SendDefMessage(Grobal2.SM_MAKEDRUG_SUCCESS, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_MAKEDRUG_FAIL:// 10151
                        nCode = 231;
                        SendDefMessage(Grobal2.SM_MAKEDRUG_FAIL, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;

                    case Grobal2.RM_DIGDOWN:// 10201
                        nCode = 234;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_DIGDOWN, ProcessMsg.BaseObject, ProcessMsg.nParam1,
                            ProcessMsg.nParam2, 0, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;

                    case Grobal2.RM_10205:// 10205
                        nCode = 240;
                        SendDefMessage(Grobal2.SM_716, ProcessMsg.BaseObject, (ushort)ProcessMsg.nParam1, (ushort)ProcessMsg.nParam2, (ushort)ProcessMsg.nParam3, "");
                        break;
                    case Grobal2.RM_CHANGEGUILDNAME:// 10301  SM_CHANGEGUILDNAME
                        nCode = 241;
                        SendChangeGuildName();
                        break;
                    case Grobal2.RM_SUBABILITY:// 10302
                        nCode = 242;
                        SendDefMessage(Grobal2.SM_SUBABILITY, HUtil32.MakeLong(HUtil32.MakeWord((byte)this.m_nAntiMagic, 0), 0),
                            HUtil32.MakeWord(this.m_btHitPoint, this.m_btSpeedPoint),
                            HUtil32.MakeWord((byte)this.m_btAntiPoison, (byte)this.m_nPoisonRecover), HUtil32.MakeWord((byte)this.m_nHealthRecover,
                            (byte)this.m_nSpellRecover), "");
                        break;
                    case Grobal2.RM_BUILDGUILD_OK:// 10303
                        nCode = 243;
                        SendDefMessage(Grobal2.SM_BUILDGUILD_OK, 0, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_BUILDGUILD_FAIL:// 10304
                        nCode = 244;
                        SendDefMessage(Grobal2.SM_BUILDGUILD_FAIL, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_DONATE_OK:// 10305
                        nCode = 245;
                        SendDefMessage(Grobal2.SM_DONATE_OK, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_DONATE_FAIL:// 10306
                        nCode = 246;
                        SendDefMessage(Grobal2.SM_DONATE_FAIL, ProcessMsg.nParam1, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_MYSTATUS:
                        nCode = 247;
                        SendDefMessage(Grobal2.SM_MYSTATUS, 0, (ushort)GetMyStatus(), 0, 0, "");
                        break;
                    case Grobal2.RM_MENU_OK:// 10309
                        nCode = 248;
                        SendDefMessage(Grobal2.SM_MENU_OK, ProcessMsg.nParam1, 0, 0, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SPACEMOVE_FIRE:
                    case Grobal2.RM_SPACEMOVE_FIRE2:// 10330
                        nCode = 249;
                        if (ProcessMsg.wIdent == Grobal2.RM_SPACEMOVE_FIRE)
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SPACEMOVE_HIDE, ProcessMsg.BaseObject, 0, 0, 0, 0);
                        }
                        else
                        {
                            this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SPACEMOVE_HIDE2, ProcessMsg.BaseObject, 0, 0, 0, 0);
                        }
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_RECONNECTION:// 10332 重新连接
                        nCode = 251;
                        m_boReconnection = true;
                        SendDefMessage(Grobal2.SM_RECONNECT, 0, 0, 0, 0, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_HIDEEVENT:// 10333
                        nCode = 252;
                        SendDefMessage(Grobal2.SM_HIDEEVENT, ProcessMsg.nParam1, (ushort)ProcessMsg.wParam, (ushort)ProcessMsg.nParam2, (ushort)ProcessMsg.nParam3, "");
                        break;
                    case Grobal2.RM_MYSHOW:// 自身动画消息
                        nCode = 254;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_MYSHOW, ProcessMsg.BaseObject, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_ADJUST_BONUS:
                        nCode = 255;
                        SendAdjustBonus();
                        break;
                    case Grobal2.RM_10401:
                        nCode = 256;
                        ChangeServerMakeSlave((TSlaveInfo)HUtil32.IntToObject<TSlaveInfo>(ProcessMsg.nParam1));
                        Dispose((TSlaveInfo)HUtil32.IntToObject<TSlaveInfo>(ProcessMsg.nParam1));
                        break;
                    case Grobal2.RM_OPENHEALTH:// 10410
                        nCode = 257;
                        //  SendDefMessage(Grobal2.SM_OPENHEALTH, ProcessMsg.BaseObject, (ushort)M2Share.ActorsSystem.Get(ProcessMsg.BaseObject).m_WAbil.HP,
                        //    (ushort)M2Share.ActorsSystem.Get(ProcessMsg.BaseObject).m_WAbil.MaxHP, 0, "");
                        var openBaseObject = M2Share.ActorsSystem.Get(ProcessMsg.BaseObject);
                        var openHealth = new THealth();
                        openHealth.HP = openBaseObject.m_WAbil.HP;
                        openHealth.MaxHP = openBaseObject.m_WAbil.MaxHP;
                        m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENHEALTH, ProcessMsg.BaseObject, 0, 0, 0, 0);   //20121019
                        SendSocket(m_DefMsg, EncryptUnit.EncodeBuffer(openHealth));
                        break;
                    case Grobal2.RM_CLOSEHEALTH:// 10411
                        nCode = 258;
                        SendDefMessage(Grobal2.SM_CLOSEHEALTH, ProcessMsg.BaseObject, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_BREAKWEAPON:// 10413
                        nCode = 259;
                        SendDefMessage(Grobal2.SM_BREAKWEAPON, ProcessMsg.BaseObject, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_10414:// 10414
                        nCode = 260;
                        //SendDefMessage(Grobal2.SM_INSTANCEHEALGUAGE, ProcessMsg.BaseObject,
                        //    (ushort)M2Share.ActorsSystem.Get(ProcessMsg.BaseObject).m_WAbil.HP, (ushort)M2Share.ActorsSystem.Get(ProcessMsg.BaseObject).m_WAbil.MaxHP, 0, "");
                        var heartHealth = new THealth();
                        var heartBaseObject = M2Share.ActorsSystem.Get(ProcessMsg.BaseObject);
                        heartHealth.HP = heartBaseObject.m_WAbil.HP;
                        heartHealth.MaxHP = heartBaseObject.m_WAbil.MaxHP;
                        m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_INSTANCEHEALGUAGE, ProcessMsg.BaseObject, 0, 0, 0, 0);
                        SendSocket(m_DefMsg, EncryptUnit.EncodeBuffer(heartHealth));
                        break;
                    case Grobal2.RM_PASSWORD:// 10416
                        nCode = 262;
                        SendDefMessage(Grobal2.SM_PASSWORD, 0, 0, 0, 0, "");
                        break;
                    case Grobal2.RM_PASSWORDSTATUS:
                        nCode = 264;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_PASSWORDSTATUS, ProcessMsg.BaseObject, ProcessMsg.nParam1, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_USERLEVELORDER:// 人物排行
                        nCode = 265;
                        UserLevelOrder(ProcessMsg.BaseObject);
                        break;
                    case Grobal2.RM_QUERYUSERLEVELSORT:
                        nCode = 266;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_QUERYUSERLEVELSORT, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_GLORY:// 发送到客户端 荣誉值 
                        nCode = 267;
                        SendGloryInfo();
                        break;
                    case Grobal2.RM_SHOWASSESSDLG:
                        // ---------------------双英雄系统-----------------------------------------------
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SHOWASSESSDLG, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_OPENTRAININGDLG:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENTRAININGDLG, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_ISDEHERO:
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_ISDEHERO, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, "");
                        break;
                    case Grobal2.RM_GETASSESSHEROINFO:
                        nCode = 268;
                        m_sAssessHeroMsg = ProcessMsg.sMsg;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_GETASSESSHEROINFO, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_QUERYASSESSHERO:
                        nCode = 268;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_QUERYASSESSHERO, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_GETHEROINFO:
                        // ---------------------酒馆系统-------------------------------------------------
                        // 客户端取得酒馆英雄存储信息
                        nCode = 268;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_GETHEROINFO, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_SENDUSERPLAYDRINK:// 发送出现请酒对话框
                        nCode = 269;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_SENDUSERPLAYDRINK, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_OPENPLAYDRINK:// 打开界面
                        nCode = 270;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_OPENPLAYDRINK, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_PlayDrinkToDrink:// 送到客户端谁赢谁输
                        nCode = 271;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_PlayDrinkToDrink, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_DrinkUpdateValue:
                        nCode = 272;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_DrinkUpdateValue, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    case Grobal2.RM_CLOSEDRINK:
                        nCode = 273;
                        this.m_DefMsg = EncryptUnit.MakeDefaultMsg(Grobal2.SM_CLOSEDRINK, ProcessMsg.nParam1, ProcessMsg.wParam, ProcessMsg.nParam2, ProcessMsg.nParam3, 0);
                        SendSocket(this.m_DefMsg, ProcessMsg.sMsg);
                        break;
                    default:
                        nCode = 274;
                        result = base.Operate(ProcessMsg);
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("[异常] TPlayObject.Operate Code:" + nCode + " :wIdent" + ProcessMsg.wIdent);
            }
            return result;
        }
    }
}
